﻿<form method="post" action="<?=base_url()?>batdongsan<?=url_suffix()?>">
<ul id="tk_bds">
    <li style="list-style:none;">
      <select name="data[loaitin]">
         <option value="">Chọn loại tin...</option>
         <?php foreach($loaitins as $lt){?>
         <option <?php if($loaitin==$lt->id){?> selected="selected"<? }?> value="<?=$lt->id;?>">&nbsp;<?=$lt->tieude;?></option>
         <? }?> 
      </select>
    </li>
    <li style="list-style:none;">
        <select name="data[loainhadat]">
           <option value="">Chọn loại nhà đất...</option>
            <?php foreach($loainhadats as $nd){?>
            <option <?php if($loainhadat==$nd->id){?> selected="selected"<? }?> value="<?=$nd->id;?>">&nbsp;<?=$nd->tieude;?></option>
            <? }?>
         </select>
      </li>
      <li style="list-style:none;">
      <select name="data[tinhthanh]" id="loadtinhtanh">
          <option value="">Chọn tỉnh thành phố...</option>
          <?php foreach($tinhthanhs as $tt){?>
          <option <?php if($tinhthanh==$tt->id){?> selected="selected"<? }?> value="<?=$tt->id;?>">&nbsp;<?=$tt->tieude;?></option>
          <? }?>
      </select>
      </li>
      <li style="list-style:none;" id="listquanhuyen">
          <select name="data[quanhuyen]"> 
           <option value="">Chọn quận huyện...</option>
           <?php foreach($quanhuyens as $qh){?>
              <option value="<?=$qh->id?>" <?php if($quanhuyen==$qh->id){?> selected="selected"<? }?>><?=$qh->tieude;?></option>
            <? }?>
           </select>
     </li>
     <li style="list-style:none;"> 
     	<select name="data[dientich]">
            <option value="">Chọn diện tích...</option>
            <?php foreach($dientichs as $dt){?>
            <option <?php if($dientich==$dt->id){?> selected="selected"<? }?> value="<?=$dt->id;?>">&nbsp;<?=$dt->tieude;?></option>
            <? }?>
         </select>
      </li>
      <li style="list-style:none;">
         <select name="data[mucgia]">
           <option value="">Chọn mức giá...</option> 
           <?php foreach($mucgias as $mg){?>
           <option <?php if($mucgia==$mg->id){?> selected="selected"<? }?> value="<?=$mg->id;?>">&nbsp;<?=$mg->tieude;?></option>
           <? }?>
         </select>
       </li>
       <li style="list-style:none; text-align:right; padding-top:8px; padding-right:16px;">
          <input type="image" src="<?=url_tmpl()?>icon/timkiem.png" />
       </li>
 </ul>
 </form>
 <style type="text/css">
 	#tk_bds li select
	{
		padding:3px 4px 4px 4px !important;
		height:26px !important; 
	}
 </style>
 <script type="text/javascript">
 	  $(function(){
		  $("#loadtinhtanh").change(function(){
			    var key = $(this).val();
				$.post('<?=base_url()?>home/loadquanhuyen<?=url_suffix()?>',{key:key},function($data){
						$("#listquanhuyen").html($data);		
				});    
		  })
	  })
 </script>